//
//  LCNetwork.h
//  LongChain
//  网络请求管理类
//  Created by FengZi on 2018/3/20.
//  Copyright © 2018年 FengZi. All rights reserved.
//

#import <Foundation/Foundation.h>
@interface LCNetwork : NSObject

/**
 网络请求单例类

 @return 返回当前网络请求单例
 */
+ (instancetype)shareInstance;

/**
 GET 请求

 @param url GET 请求URL
 @param responseSuccessBlock 请求服务器成功的回调
 @param responseFailBlock 请求服务器失败的回调
 */
- (void)lc_getNetworkWithURL:(NSString *)url
             responseSuccess:(void (^)(id resultCode, id resultParameter))responseSuccessBlock
                responseFail:(void (^)(id resultCode, NSError *error))responseFailBlock;

/**
 POST 请求

 @param url POST 请求URL
 @param parameter POST 请求参数
 @param responseSuccessBlock 请求服务器成功的回调
 @param responseFailBlock 请求服务器失败的回调
 */
- (void)lc_postNetworkWithRUL:(NSString *)url
                    parameter:(id)parameter
              responseSuccess:(void (^)(id resultCode, id resultParameter))responseSuccessBlock
                 responseFail:(void (^)(id resultCode, NSError *error))responseFailBlock;

/**
 *  @author Yun
 *
 *  上传图片文件
 *
 *  @param uploadFile         需上传的文件 type: image data str
 *  @param seriviceURL         服务器路径
 *  @param mimeTypeStr        mimeType
 *  @param nameStr            名称
 *  @param fileNameStr        文件名
 *  @param uploadParameter    参数
 *  @param uploadSuccessBlock 上传成功回调
 *  @param uploadFailBlock    上传失败回调
 */
- (void)uploadFile:(id)uploadFile
              Path:(NSString *)seriviceURL
          mimeType:(NSString *)mimeTypeStr
              name:(NSString *)nameStr
              Name:(NSString *)fileNameStr
         parameter:(id)uploadParameter
      successBlock:(void (^)(id sender))uploadSuccessBlock
         failBlock:(void (^)(id sender))uploadFailBlock;

- (void)lc_download;

- (void)uploadFile;

@end
